home *** CD-ROM | disk | FTP | other *** search
/ Reverse Code Engineering RCE CD +sandman 2000 / ReverseCodeEngineeringRceCdsandman2000.iso / RCE / Library / Window Info / WINHDR.TXT < prev    next >
Encoding:
Text File  |  2000-05-25  |  28.4 KB  |  684 lines

  1.   Executable-File Header Format (3.1)
  2.  ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  3. An executable (.EXE) file for the Windows operating system contains a
  4. combination of code and data or a combination of code, data, and resources.
  5. The executable file also contains two headers: an MS-DOS header and a
  6. Windows header. The next two sections describe these headers; the third
  7. section describes the code and data contained in a Windows executable file.
  8.  
  9.  MS-DOS Header
  10.  ▀▀▀▀▀▀▀▀▀▀▀▀▀
  11. The MS-DOS (old-style) executable-file header contains four distinct parts:
  12. a collection of header information (such as the signature word, the file
  13. size, and so on), a reserved section, a pointer to a Windows header (if one
  14. exists), and a stub program.
  15.  
  16. If the word value at offset 18h is 40h or greater, the word value at 3Ch is
  17. typically an offset to a Windows header. Applications must verify this for
  18. each executable-file header being tested, because a few applications have a
  19. different header style.
  20.  
  21. MS-DOS uses the stub program to display a message if Windows has not been
  22. loaded when the user attempts to run a program.
  23.  
  24.  Windows Header
  25.  ▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  26. The Windows (new-style) executable-file header contains information that the
  27. loader requires for segmented executable files. This information includes
  28. the linker version number, data specified by the linker, data specified by
  29. the resource compiler, tables of segment data, tables of resource data, and
  30. so on. The following illustration shows the Windows executable-file header:
  31.  
  32. The following sections describe the entries in the Windows executable-file
  33. header.
  34.  
  35.  Information Block
  36.  ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  37. The information block in the Windows header contains the linker version
  38. number, the lengths of various tables that further describe the executable
  39. file, the offsets from the beginning of the header to the beginning of these
  40. tables, the heap and stack sizes, and so on. The following list summarizes
  41. the contents of the header information block (the locations are relative to
  42. the beginning of the block):
  43.  
  44.  Location │ Description
  45.  ═════════╪═════════════════════════════════════════════════════════════════
  46.   00h     │ Specifies the signature word. The low byte contains "N" (4Eh)
  47.           │ and the high byte contains "E" (45h).
  48.           │
  49.   02h     │ Specifies the linker version number.
  50.           │
  51.   03h     │ Specifies the linker revision number.
  52.           │
  53.   04h     │ Specifies the offset to the entry table (relative to the
  54.           │ beginning of the header).
  55.           │
  56.   06h     │ Specifies the length of the entry table, in bytes.
  57.           │
  58.   08h     │ Reserved.
  59.           │
  60.   0Ch     │ Specifies flags that describe the contents of the executable
  61.           │ file. This value can be one or more of the following bits:
  62.           │
  63.           │ Bit │ Meaning
  64.           │ ════╪═══════════════════════════════════════════════════════════
  65.           │  0  │ The linker sets this bit if the executable-file format is
  66.           │     │ SINGLEDATA. An executable file with this format contains
  67.           │     │ one data segment. This bit is set if the file is a
  68.           │     │ dynamic-link library (DLL).
  69.           │     │
  70.           │  1  │ The linker sets this bit if the executable-file format is
  71.           │     │ MULTIPLEDATA. An executable file with this format
  72.           │     │ contains multiple data segments. This bit is set if the
  73.           │     │ file is a Windows application.
  74.           │     │
  75.           │     │ If neither bit 0 nor bit 1 is set, the executable-file
  76.           │     │ format is NOAUTODATA. An executable file with this format
  77.           │     │ does not contain an automatic data segment.
  78.           │     │
  79.           │  2  │ Reserved.
  80.           │     │
  81.           │  3  │ Reserved.
  82.           │     │
  83.           │  8  │ Reserved.
  84.           │     │
  85.           │  9  │ Reserved.
  86.           │     │
  87.           │ 11  │ If this bit is set, the first segment in the executable
  88.           │     │ file contains code that loads the application.
  89.           │     │
  90.           │ 13  │ If this bit is set, the linker detects errors at link
  91.           │     │ time but still creates an executable file.
  92.           │     │
  93.           │ 14  │ Reserved.
  94.           │     │
  95.           │ 15  │ If this bit is set, the executable file is a library module.
  96.           │     │
  97.           │     │ If bit 15 is set, the CS:IP registers point to an
  98.           │     │ initialization procedure called with the value in the AX
  99.           │     │ register equal to the module handle. The initialization
  100.           │     │ procedure must execute a far return to the caller. If the
  101.           │     │ procedure is successful, the value in AX is nonzero.
  102.           │     │ Otherwise, the value in AX is zero.
  103.           │     │
  104.           │     │ The value in the DS register is set to the library's data
  105.           │     │ segment if SINGLEDATA is set. Otherwise, DS is set to the
  106.           │     │ data segment of the application that loads the library.
  107.           │
  108.   0Eh     │ Specifies the automatic data segment number. (0Eh is zero if the
  109.           │ SINGLEDATA and MULTIPLEDATA bits are cleared.)
  110.           │
  111.   10h     │ Specifies the initial size, in bytes, of the local heap. This
  112.           │ value is zero if there is no local allocation.
  113.           │
  114.   12h     │ Specifies the initial size, in bytes, of the stack. This value
  115.           │ is zero if the SS register value does not equal the DS register
  116.           │ value.
  117.           │
  118.   14h     │ Specifies the segment:offset value of CS:IP.
  119.           │
  120.   18h     │ Specifies the segment:offset value of SS:SP.
  121.           │
  122.           │ The value specified in SS is an index to the module's segment
  123.           │ table. The first entry in the segment table corresponds to
  124.           │ segment number 1.
  125.           │
  126.           │ If SS addresses the automatic data segment and SP is zero, SP
  127.           │ is set to the address obtained by adding the size of the
  128.           │ automatic data segment to the size of the stack.
  129.           │
  130.   1Ch     │ Specifies the number of entries in the segment table.
  131.           │
  132.   1Eh     │ Specifies the number of entries in the module-reference table.
  133.           │
  134.   20h     │ Specifies the number of bytes in the nonresident-name table.
  135.           │
  136.   22h     │ Specifies a relative offset from the beginning of the Windows
  137.           │ header to the beginning of the segment table.
  138.           │
  139.   24h     │ Specifies a relative offset from the beginning of the Windows
  140.           │ header to the beginning of the resource table.
  141.           │
  142.   26h     │ Specifies a relative offset from the beginning of the Windows
  143.           │ header to the beginning of the resident-name table.
  144.           │
  145.   28h     │ Specifies a relative offset from the beginning of the Windows
  146.           │ header to the beginning of the module-reference table.
  147.           │
  148.   2Ah     │ Specifies a relative offset from the beginning of the Windows
  149.           │ header to the beginning of the imported-name table.
  150.           │
  151.   2Ch     │ Specifies a relative offset from the beginning of the file to
  152.           │ the beginning of the nonresident-name table.
  153.           │
  154.   30h     │ Specifies the number of movable entry points.
  155.           │
  156.   32h     │ Specifies a shift count that is used to align the logical
  157.           │ sector. This count is log2 of the segment sector size. It is
  158.           │ typically 4, although the default count is 9. (This value
  159.           │ corresponds to the /alignment [/a] linker switch. When the
  160.           │ linker command line contains /a:16, the shift count is 4.
  161.           │
  162.           │ When the linker command line contains /a:512, the shift count is
  163.           │ 9.)
  164.           │
  165.   34h     │ Specifies the number of resource segments.
  166.           │
  167.   36h     │ Specifies the target operating system, depending on which bits
  168.           │ are set:
  169.           │
  170.           │ Bit │ Meaning
  171.           │ ════╪═══════════════════════════════════════════════════════════
  172.           │  0  │ Operating system format is unknown.
  173.           │     │
  174.           │  1  │ Reserved.
  175.           │     │
  176.           │  2  │ Operating system is Microsoft Windows.
  177.           │     │
  178.           │  3  │ Reserved.
  179.           │     │
  180.           │  4  │ Reserved.
  181.           │     │
  182.   37h     │ Specifies additional information about the executable file. It
  183.           │ can be one or more of the following values:
  184.           │
  185.           │ Bit │ Meaning
  186.           │ ════╪═══════════════════════════════════════════════════════════
  187.           │  1  │ If this bit is set, the executable file contains a
  188.           │     │ Windows 2.x application that runs in version 3.x
  189.           │     │ protected mode.
  190.           │     │
  191.           │  2  │ If this bit is set, the executable file contains a
  192.           │     │ Windows 2.x application that supports proportional fonts.
  193.           │     │
  194.           │  3  │ If this bit is set, the executable file contains a
  195.           │     │ fast-load area.
  196.           │
  197.   38h     │ Specifies the offset, in sectors, to the beginning of the
  198.           │ fast-load area. (Only Windows uses this value.)
  199.           │
  200.   3Ah     │ Specifies the length, in sectors, of the fast-load area. (Only
  201.           │ Windows uses this value.)
  202.           │
  203.   3Ch     │ Reserved.
  204.           │
  205.   3Eh     │ Specifies the expected version number for Windows. (Only
  206.           │ Windows uses this value.)
  207.  
  208.  Segment Table
  209.  ▀▀▀▀▀▀▀▀▀▀▀▀▀
  210. The segment table contains information that describes each segment in an
  211. executable file. This information includes the segment length, segment type,
  212. and segment-relocation data. The following list summarizes the values found
  213. in the segment table (the locations are relative to the beginning of each
  214. entry):
  215.  
  216.  Location │ Description
  217.  ═════════╪═════════════════════════════════════════════════════════════════
  218.   00h     │ Specifies the offset, in sectors, to the segment data (relative
  219.           │ to the beginning of the file). A value of zero means no data
  220.           │ exists.
  221.           │
  222.   02h     │ Specifies the length, in bytes, of the segment, in the file. A
  223.           │ value of zero indicates that the segment length is 64K, unless
  224.           │ the selector offset is also zero.
  225.           │
  226.   04h     │ Specifies flags that describe the contents of the executable
  227.           │ file. This value can be one or more of the following:
  228.           │
  229.           │ Bit │ Meaning
  230.           │ ════╪═══════════════════════════════════════════════════════════
  231.           │  0  │ If this bit is set, the segment is a data segment.
  232.           │     │ Otherwise, the segment is a code segment.
  233.           │     │
  234.           │  1  │ If this bit is set, the loader has allocated memory for
  235.           │     │ the segment.
  236.           │     │
  237.           │  2  │ If this bit is set, the segment is loaded.
  238.           │     │
  239.           │  3  │ Reserved.
  240.           │     │
  241.           │  4  │ If this bit is set, the segment type is MOVABLE.
  242.           │     │ Otherwise, the segment type is FIXED.
  243.           │     │
  244.           │  5  │ If this bit is set, the segment type is PURE or
  245.           │     │ SHAREABLE. Otherwise, the segment type is IMPURE or
  246.           │     │ NONSHAREABLE.
  247.           │     │
  248.           │  6  │ If this bit is set, the segment type is PRELOAD.
  249.           │     │ Otherwise, the segment type is LOADONCALL.
  250.           │     │
  251.           │  7  │ If this bit is set and the segment is a code segment, the
  252.           │     │ segment type is EXECUTEONLY. If this bit is set and the
  253.           │     │ segment is a data segment, the segment type is READONLY.
  254.           │     │
  255.           │  8  │ If this bit is set, the segment contains relocation data.
  256.           │     │
  257.           │  9  │ Reserved.
  258.           │     │
  259.           │ 10  │ Reserved.
  260.           │     │
  261.           │ 11  │ Reserved.
  262.           │     │
  263.           │ 12  │ If this bit is set, the segment is discardable.
  264.           │     │
  265.           │ 13  │ Reserved.
  266.           │     │
  267.           │ 14  │ Reserved.
  268.           │     │
  269.           │ 15  │ Reserved.
  270.           │
  271.   06h     │ Specifies the minimum allocation size of the segment, in bytes.
  272.           │ A value of zero indicates that the minimum allocation size is
  273.           │ 64K.
  274.  
  275.  Resource Table
  276.  ▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  277. The resource table describes and identifies the location of each resource in
  278. the executable file. The table has the following form:
  279.  
  280. 
  281.  WORD     rscAlignShift;
  282.  TYPEINFO rscTypes[];
  283.  WORD     rscEndTypes;
  284.  BYTE     rscResourceNames[];
  285.  BYTE     rscEndNames;
  286. 
  287.  
  288. Following are the members in the resource table:
  289.  
  290.  rscAlignShift    │ Specifies the alignment shift count for resource data.
  291.                   │ When the shift count is used as an exponent of 2, the
  292.                   │ resulting value specifies the factor, in bytes, for
  293.                   │ computing the location of a resource in the executable
  294.                   │ file.
  295.                   │
  296.  rscTypes         │ Specifies an array of TYPEINFO structures containing
  297.                   │ information about resource types. There must be one
  298.                   │ TYPEINFO structure for each type of resource in the
  299.                   │ executable file.
  300.                   │
  301.  rscEndTypes      │ Specifies the end of the resource type definitions. This
  302.                   │ member must be zero.
  303.                   │
  304.  rscResourceNames │ Specifies the names (if any) associated with the
  305.                   │ resources in this table. Each name is stored as
  306.                   │ consecutive bytes; the first byte specifies the number
  307.                   │ of characters in the name.
  308.                   │
  309.  rscEndNames      │ Specifies the end of the resource names and the end of
  310.                   │ the resource table. This member must be zero.
  311.  
  312.  Type Information
  313.  ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  314. The TYPEINFO structure has the following form:
  315.  
  316. 
  317.  typedef struct _TYPEINFO {
  318.      WORD        rtTypeID;
  319.      WORD        rtResourceCount;
  320.      DWORD       rtReserved;
  321.      NAMEINFO    rtNameInfo[];
  322.  } TYPEINFO;
  323. 
  324.  
  325. Following are the members in the TYPEINFO structure:
  326.  
  327.  rtTypeID         │ Specifies the type identifier of the resource. This
  328.                   │ integer value is either a resource-type value or an
  329.                   │ offset to a resource-type name. If the high bit in this
  330.                   │ member is set (0x8000), the value is one of the
  331.                   │ following resource-type values:
  332.                   │
  333.                   │ Value           │ Resource type
  334.                   │ ════════════════╪═════════════════════════════════════
  335.                   │ RT_ACCELERATOR  │ Accelerator table
  336.                   │                 │
  337.                   │ RT_BITMAP       │ Bitmap
  338.                   │                 │
  339.                   │ RT_CURSOR       │ Cursor
  340.                   │                 │
  341.                   │ RT_DIALOG       │ Dialog box
  342.                   │                 │
  343.                   │ RT_FONT         │ Font component
  344.                   │                 │
  345.                   │ RT_FONTDIR      │ Font directory
  346.                   │                 │
  347.                   │ RT_GROUP_CURSOR │ Cursor directory
  348.                   │                 │
  349.                   │ RT_GROUP_ICON   │ Icon directory
  350.                   │                 │
  351.                   │ RT_ICON         │ Icon
  352.                   │                 │
  353.                   │ RT_MENU         │ Menu
  354.                   │                 │
  355.                   │ RT_RCDATA       │ Resource data
  356.                   │                 │
  357.                   │ RT_STRING       │ String table
  358.                   │
  359.                   │ If the high bit of the value in this member is not set,
  360.                   │ the value represents an offset, in bytes relative to
  361.                   │ the beginning of the resource table, to a name in the
  362.                   │ rscResourceNames member.
  363.                   │
  364. rtResourceCount   │ Specifies the number of resources of this type in the
  365.                   │ executable file.
  366.                   │
  367. rtReserved        │ Reserved.
  368.                   │
  369. rtNameInfo        │ Specifies an array of NAMEINFO structures containing
  370.                   │ information about individual resources. The
  371.                   │ rtResourceCount member specifies the number of
  372.                   │ structures in the array.
  373.  
  374.  Name Information
  375.  ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  376. The NAMEINFO structure has the following form:
  377.  
  378. 
  379.  typedef struct _NAMEINFO {
  380.      WORD rnOffset;
  381.      WORD rnLength;
  382.      WORD rnFlags;
  383.      WORD rnID;
  384.      WORD rnHandle;
  385.      WORD rnUsage;
  386.  } NAMEINFO;
  387. 
  388.  
  389. Following are the members in the NAMEINFO structure:
  390.  
  391.  rnOffset │ Specifies an offset to the contents of the resource data
  392.           │ (relative to the beginning of the file). The offset is in terms
  393.           │ of alignment units specified by the rscAlignShift member at
  394.           │ the beginning of the resource table.
  395.           │
  396.  rnLength │ Specifies the resource length, in bytes.
  397.           │
  398.  rnFlags  │ Specifies whether the resource is fixed, preloaded, or shareable.
  399.           │ This member can be one or more of the following values:
  400.           │
  401.           │ Value  │ Meaning
  402.           │ ═══════╪════════════════════════════════════════════════════════
  403.           │ 0x0010 │ Resource is movable (MOVEABLE). Otherwise, it is fixed.
  404.           │        │
  405.           │ 0x0020 │ Resource can be shared (PURE).
  406.           │        │
  407.           │ 0x0040 │ Resource is preloaded (PRELOAD). Otherwise, it is
  408.           │        │ loaded on demand.
  409.           │
  410.  rnID     │ Specifies or points to the resource identifier. If the
  411.           │ identifier is an integer, the high bit is set (8000h).
  412.           │ Otherwise, it is an offset to a resource string, relative to
  413.           │ the beginning of the resource table.
  414.           │
  415.  rnHandle │ Reserved.
  416.           │
  417.  rnUsage  │ Reserved.
  418.  
  419.  Resident-Name Table
  420.  ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  421. The resident-name table contains strings that identify exported functions in
  422. the executable file. As the name implies, these strings are resident in
  423. system memory and are never discarded. The resident-name strings are
  424. case-sensitive and are not null-terminated. The following list summarizes
  425. the values found in the resident-name table (the locations are relative to
  426. the beginning of each entry):
  427.  
  428.  Location  │ Description
  429.  ══════════╪════════════════════════════════════════════════════════════════
  430.    00h     │ Specifies the length of a string. If there are no more strings
  431.            │ in the table, this value is zero.
  432.            │
  433.  01h - xxh │ Specifies the resident-name text. This string is case-sensitive
  434.            │ and is not null-terminated.
  435.            │
  436.  xxh + 01h │ Specifies an ordinal number that identifies the string. This
  437.            │ number is an index into the entry table.
  438.  
  439. The first string in the resident-name table is the module name.
  440.  
  441.  Module-Reference Table
  442.  ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  443. The module-reference table contains offsets for module names stored in the
  444. imported-name table. Each entry in this table is 2 bytes long.
  445.  
  446.  Imported-Name Table
  447.  ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  448. The imported-name table contains the names of modules that the executable
  449. file imports. Each entry contains two parts: a single byte that specifies
  450. the length of the string and the string itself. The strings in this table
  451. are not null-terminated.
  452.  
  453.  Entry Table
  454.  ▀▀▀▀▀▀▀▀▀▀▀
  455. The entry table contains bundles of entry points from the executable file
  456. (the linker generates each bundle). The numbering system for these ordinal
  457. values is 1-based--that is, the ordinal value corresponding to the first
  458. entry point is 1.
  459.  
  460. The linker generates the densest possible bundles under the restriction that
  461. it cannot reorder the entry points. This restriction is necessary because
  462. other executable files may refer to entry points within a given bundle by
  463. their ordinal values.
  464.  
  465. The entry-table data is organized by bundle, each of which begins with a
  466. 2-byte header. The first byte of the header specifies the number of entries
  467. in the bundle (a value of 00h designates the end of the table). The second
  468. byte specifies whether the corresponding segment is movable or fixed. If the
  469. value in this byte is 0FFh, the segment is movable.
  470.  
  471. If the value in this byte is 0FEh, the entry does not refer to a segment
  472. but refers, instead, to a constant defined within the module. If the value
  473. in this byte is neither 0FFh nor 0FEh, it is a segment index.
  474.  
  475. For movable segments, each entry consists of 6 bytes and has the following
  476. form:
  477.  
  478.  Location │ Description
  479.  ═════════╪═════════════════════════════════════════════════════════════════
  480.   00h     │ Specifies a byte value. This value can be a combination of the
  481.           │ following bits:
  482.           │
  483.           │ Bit(s) │ Meaning
  484.           │ ═══════╪════════════════════════════════════════════════════════
  485.           │   0    │ If this bit is set, the entry is exported.
  486.           │        │
  487.           │   1    │ If this bit is set, the segment uses a global (shared)
  488.           │        │ data segment.
  489.           │        │
  490.           │  3-7   │ If the executable file contains code that performs
  491.           │        │ ring transitions, these bits specify the number of
  492.           │        │ words that compose the stack. At the time of the ring
  493.           │        │ transition, these words must be copied from one ring
  494.           │        │ to the other.
  495.           │
  496.   01h     │ Specifies an int 3fh instruction.
  497.           │
  498.   03h     │ Specifies the segment number.
  499.           │
  500.   04h     │ Specifies the segment offset.
  501.  
  502. For fixed segments, each entry consists of 3 bytes and has the following
  503. form:
  504.  
  505.  Location │ Description
  506.  ═════════╪════════════════════════════════════════════════════════════════
  507.   00h     │ Specifies a byte value. This value can be a combination of the
  508.           │ following bits:
  509.           │
  510.           │ Bit(s) │ Meaning
  511.           │ ═══════╪═══════════════════════════════════════════════════════
  512.           │  0     │ If this bit is set, the entry is exported.
  513.           │        │
  514.           │  1     │ If this bit is set, the entry uses a global (shared)
  515.           │        │ data segment. (This may be set only for SINGLEDATA
  516.           │        │ library modules.)
  517.           │        │
  518.           │ 3-7    │ If the executable file contains code that performs
  519.           │        │ ring transitions, these bits specify the number of
  520.           │        │ words that compose the stack. At the time of the ring
  521.           │        │ transition, these words must be copied from one ring
  522.           │        │ to the other.
  523.           │
  524.   01h     │ Specifies an offset.
  525.  
  526.  Nonresident-Name Table
  527.  ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  528. The nonresident-name table contains strings that identify exported functions
  529. in the executable file. As the name implies, these strings are not always
  530. resident in system memory and are discardable. The nonresident-name strings
  531. are case-sensitive; they are not null-terminated. The following list
  532. summarizes the values found in the nonresident-name table (the specified
  533. locations are relative to the beginning of each entry):
  534.  
  535.  Location  │ Description
  536.  ══════════╪═══════════════════════════════════════════════════════════════
  537.   00h      │ Specifies the length, in bytes, of a string. If this byte is
  538.            │ 00h, there are no more strings in the table.
  539.            │
  540.  01h - xxh │ Specifies the nonresident-name text. This string is
  541.            │ case-sensitive and is not null-terminated.
  542.            │
  543.  xx + 01h  │ Specifies an ordinal number that is an index to the entry
  544.            │ table.
  545.  
  546. The first name that appears in the nonresident-name table is the module
  547. description string (which was specified in the module-definition file).
  548.  
  549.  Code Segments and Relocation Data
  550.  ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  551. Code and data segments follow the Windows header. Some of the code segments
  552. may contain calls to functions in other segments and may, therefore, require
  553. relocation data to resolve those references. This relocation data is stored
  554. in a relocation table that appears immediately after the code or data in the
  555. segment.
  556.  
  557. The first 2 bytes in this table specify the number of relocation
  558. items the table contains. A relocation item is a collection of bytes
  559. specifying the following information:
  560.  
  561.  ■ Address type (segment only, offset only, segment and offset)
  562.  ■ Relocation type (internal reference, imported ordinal, imported name)
  563.  ■ Segment number or ordinal identifier (for internal references)
  564.  ■ Reference-table index or function ordinal number (for imported ordinals)
  565.  ■ Reference-table index or name-table offset (for imported names)
  566.  
  567. Each relocation item contains 8 bytes of data, the first byte of which
  568. specifies one of the following relocation-address types:
  569.  
  570.  Value │ Meaning
  571.  ══════╪═══════════════════════════════════════════════════════════════════
  572.    0   │ Low byte at the specified offset
  573.        │
  574.    2   │ 16-bit selector
  575.        │
  576.    3   │ 32-bit pointer
  577.        │
  578.    5   │ 16-bit offset
  579.        │
  580.   11   │ 48-bit pointer
  581.        │
  582.   13   │ 32-bit offset
  583.  
  584. The second byte specifies one of the following relocation types:
  585.  
  586.  Value │ Meaning
  587.  ══════╪═══════════════════════════════════════════════════════════════════
  588.    0   │ Internal reference
  589.        │
  590.    1   │ Imported ordinal
  591.        │
  592.    2   │ Imported name
  593.        │
  594.    3   │ OSFIXUP
  595.  
  596. The third and fourth bytes specify the offset of the relocation item within
  597. the segment.
  598.  
  599. If the relocation type is imported ordinal, the fifth and sixth bytes
  600. specify an index to a module's reference table and the seventh and eighth
  601. bytes specify a function ordinal value.
  602.  
  603. If the relocation type is imported name, the fifth and sixth bytes specify
  604. an index to a module's reference table and the seventh and eighth bytes
  605. specify an offset to an imported-name table.
  606.  
  607. If the relocation type is internal reference and the segment is fixed, the
  608. fifth byte specifies the segment number, the sixth byte is zero, and the
  609. seventh and eighth bytes specify an offset to the segment. If the relocation
  610. type is internal reference and the segment is movable, the fifth byte
  611. specifies 0FFh, the sixth byte is zero; and the seventh and eighth bytes
  612. specify an ordinal value found in the segment's entry table.
  613.  
  614.  
  615. Offset 339B3B - keyword Execute-lpDoc
  616.   Execute (OLE 1.x)
  617.  ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  618.  Declaration:
  619.   OLESTATUS Execute(lpDoc, hCommands)
  620.   LPOLESERVERDOC lpDoc;
  621.   HGLOBAL hCommands;
  622.  
  623. The Execute function receives WM_DDE_EXECUTE commands sent by client
  624. applications. The applications send these commands by calling the
  625. OleExecute function.
  626.  
  627.  Parameter │ Description
  628.  ══════════╪════════════════════════════════════════════════════════════════
  629.  lpDoc     │ Points to an OLESERVERDOC structure to which the dynamic data
  630.            │ exchange (DDE) commands apply.
  631.            │
  632.  hCommands │ Identifies memory containing one or more DDE execute commands.
  633.  
  634.  Returns:
  635. The return value is OLE_OK if the function is successful. Otherwise, it is
  636. an error value.
  637.  
  638.  Comments:
  639. The server should never free the handle specified in the hCommands
  640. parameter.
  641.  
  642.  
  643.  
  644. Offset 33C06E - keyword Execute-lpServer
  645.   Execute (OLE 1.x)
  646.  ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  647.  Declaration:
  648.   OLESTATUS Execute(lpServer, hCommands)
  649.   LPOLESERVER lpServer;
  650.   HGLOBAL hCommands;
  651.  
  652. The Execute function receives WM_DDE_EXECUTE commands sent by client
  653. applications. The applications send these commands by calling the
  654. OleExecute function.
  655.  
  656.  Parameter │ Description
  657.  ══════════╪═══════════════════════════════════════════════════════════════
  658.  lpServer  │ Points to an OLESERVER structure identifying the server.
  659.  hCommands │ Identifies memory containing one or more dynamic data exchange
  660.            │ (DDE) execute commands.
  661.  
  662.  Returns:
  663. The return value is OLE_OK if the function is successful. Otherwise, it is
  664. an error value.
  665.  
  666.  Comments:
  667. The server should never free the handle specified in the hCommands
  668. parameter.
  669.  
  670.  
  671. Offset 2A35E1 - keyword EXETYPE-Module-Definition
  672.   EXETYPE Module Definition Statement
  673.  ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  674. EXETYPE Module-Definition Statement EXETYPE headertype
  675.  
  676. The EXETYPE statement specifies the default executable-file (.EXE) header
  677. type. The statement is required for every Windows application.
  678.  
  679.  Parameter  │ Description
  680.  ═══════════╪═══════════════════════════════════════════════════════════════
  681.  headertype │ Specifies the header type. When linking an application
  682.             │ intended for the Windows environment, set this parameter to
  683.             │ the value "WINDOWS".
  684.